package com.ibeeking.found.common.config.feign;

import com.ibeeking.found.common.config.feign.fallback.OrgFeignBFallbackFactory;
import com.ibeeking.found.common.entity.DepartmentDTO;
import com.ibeeking.found.common.entity.query.DepartmentFeignQuery;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @Author ibeeking
 */
@FeignClient(name = "base-org-b-server", path = "/b", contextId = "orgFeignBClient", fallbackFactory = OrgFeignBFallbackFactory.class, decode404 = true)
public interface OrgFeignBClient {

    /**
     * 获取文件流
     *
     * @param query
     * @return
     */
    @PostMapping(value = "/org/feign/v1/queryOrgList")
    ResponseResult<List<DepartmentDTO>> queryOrgList(@RequestBody DepartmentFeignQuery query) ;
    /**
     * 获取文件流
     *
     * @param orgId
     * @return
     */
    @PostMapping(value = "/org/feign/v1/queryOrg/{orgId}")
    ResponseResult<DepartmentDTO> queryOrg(@PathVariable("orgId") Long orgId);
}
